/* eslint-disable react/jsx-pascal-case */
import React,{useEffect} from 'react'
import {Outlet} from "react-router-dom"
import {mainRouter} from "../router/Router_config"
import My_nav from "../components/My_nav"
import My_header from "../components/My_header"
import {useDispatch} from "react-redux"
import { RootDispatch } from '../utils'
import { get_list } from '../api'
type Props = {}

const Index = (props: Props) => {
  const dispatch:RootDispatch = useDispatch()
  useEffect(()=>{
    dispatch(get_list())
  },[dispatch])
  return (
    <div className='index'>
      <header>
        <My_header/>
      </header>
      <div>
        <My_nav mainRouter={mainRouter}/>
      </div>
      <main>
        <Outlet></Outlet>
      </main>
    </div>
  )
}

export default Index